package com.example.postgresql.controller;

import com.example.postgresql.entity.Test1;
import com.example.postgresql.service.Test1Service;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * (Test1)表控制层
 *
 * @author makejava
 * @since 2021-09-26 22:15:10
 */
@RestController
@RequestMapping("test")
public class Test1Controller {
    /**
     * 服务对象
     */
    @Resource
    private Test1Service test1Service;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Test1 selectOne(Integer id) {
        return this.test1Service.queryById(id);
    }

    @GetMapping("queryAll")
    public Map<String, Object> queryAll(Test1 test1) {
        return this.test1Service.queryAll(test1);
    }

    @GetMapping("hi")
    public String hi() {
        return "this.test1Service.queryAll()";
    }

}
